package cn.zwx.order.clients;

import cn.zwx.base.constant.ResponseMsg;
import cn.zwx.order.req.DeductionRepertoryReq;
import cn.zwx.order.req.QueryGoodsInfoReq;
import cn.zwx.order.resp.DeductionRepertoryResp;
import cn.zwx.order.resp.QueryGoodsInfoResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @description: 商品系统Api
 * @projectName:rocket-mq-example
 * @see:cn.zwx.order.clients
 * @author:zhangwenxue
 * @createTime:2020/10/15 10:22
 * @version:1.0
 */
@FeignClient(name = "goods-service")
public interface GoodsClient {

    /**
     * @description 查询商品信息
     * @param req 请求参数
     * @return cn.zwx.base.constant.ResponseMsg<cn.zwx.order.resp.QueryGoodsInfoResp>
     * @author zhangwenxue
     * @createTime 2020/10/15 12:02
     **/
    @RequestMapping(value = "/goods/query/info",method = RequestMethod.POST)
    ResponseMsg<QueryGoodsInfoResp> queryGoodsInfo(@RequestBody QueryGoodsInfoReq req);


    /**
     * @description 扣减库存
     * @param req 请求参数
     * @return cn.zwx.base.constant.ResponseMsg<cn.zwx.order.resp.QueryGoodsInfoResp>
     * @author zhangwenxue
     * @createTime 2020/10/15 12:02
     **/
    @RequestMapping(value = "/goods/update/info",method = RequestMethod.POST)
    ResponseMsg<DeductionRepertoryResp> deductionRepertory(@RequestBody DeductionRepertoryReq req);

}
